<!DOCTYPE html>
<html
        xmlns:th="http://www.thymeleaf.org"
        xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
        layout:decorate="~{common/base}">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">

</head>
<body>
<div layout:fragment="index">

    <!-- jQuery 3 -->
    <script th:src="@{~/js/jquery.min.js}" th:inline="javascript" type="text/javascript"></script>
    <!-- jQuery UI 1.11.4 -->
    <script th:src="@{~/js/plugins/jQueryUI/jquery-ui.js}" th:inline="javascript" type="text/javascript"></script>
    <!-- Bootstrap 3.3.7 -->
    <script th:src="@{~/js/plugins/bootstrap/js/bootstrap.min.js}" th:inline="javascript" type="text/javascript"></script>
    <!-- DataTables -->
    <script th:src="@{~/js/plugins/datatables.net/js/jquery.dataTables.min.js}" th:inline="javascript" type="text/javascript"></script>
    <script th:src="@{~/js/plugins/datatables.net-bs/js/dataTables.bootstrap.min.js}" th:inline="javascript" type="text/javascript"></script>
    <script th:src="@{~/js/biz/fnReloadAjax.js}" th:inline="javascript" type="text/javascript"></script>
    <!-- zTree-->
    <script th:src="@{~/js/plugins/ztree/jquery.ztree.all.js}" th:inline="javascript" type="text/javascript"></script>
    <!-- select2-->
    <script th:src="@{~/js/plugins/select2/js/select2.js}" th:inline="javascript" type="text/javascript"></script>
    <script th:src="@{~/js/plugins/select2/js/i18n/zh-CN.js}" th:inline="javascript" type="text/javascript"></script>

    <script th:src="@{~/js/biz/dataTables.js}" th:inline="javascript" type="text/javascript"></script>
    <script th:src="@{~/js/biz/ztree.js}" th:inline="javascript" type="text/javascript"></script>
    <script th:src="@{~/js/biz/select2Util.js}" th:inline="javascript" type="text/javascript"></script>
    <script th:src="@{~/js/biz/catalog.js}" th:inline="javascript" type="text/javascript"></script>

    <script type="text/javascript">
        $(function () {
            DataTables.catalogTable();
            DataTables.attributeTable();
        });
    </script>

    <section class="content-header">
        <h1>
            数据编目服务
            <small>类目管理</small>
        </h1>
    </section>

    <section class="content">
        <div class="row">
            <div class="col-xs-12">
                <div class="box">
                    <div class="box-header">
                        <h3 class="box-title">类目管理</h3>
                    </div>
                    <div class="box-body">
                        <button type="button" class="btn btn-default" data-toggle="modal" data-target="#addCatalog">类目注册</button>
                        <br>
                        <br>
                        <table id="catalogTable" class="table table-bordered table-striped" style="width: 100%">

                        </table>
                    </div>
                </div>
            </div>
        </div>
    </section>

    <!--添加类目Modal-->
    <div class="modal fade" id="addCatalog">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close" onclick="$('#catalogForm')[0].reset()">
                        <span aria-hidden="true">&times;</span></button>
                    <h4 class="modal-title">类目注册</h4>
                </div>
                <div class="modal-body">
                    <!-- form start -->
                    <form class="form-horizontal" id="catalogForm">
                        <div class="box-body">
                            <div class="form-group">
                                <label for="className" class="col-sm-2 control-label">类目名称</label>

                                <div class="col-sm-10">
                                    <input type="text" class="form-control" id="className" name="className" placeholder="请输入类目名称">
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="className" class="col-sm-2 control-label">类目描述</label>

                                <div class="col-sm-10">
                                    <textarea type="text" class="form-control" id="remark" name="remark" placeholder="请输入类目描述"></textarea>
                                </div>
                            </div>
                        </div>
                    </form>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default pull-left" data-dismiss="modal" onclick="$('#catalogForm')[0].reset()">关闭</button>
                    <button type="button" class="btn btn-primary" onclick="CataLog.saveCataLog()">保存</button>
                </div>
            </div>
        </div>
    </div>

    <!--设置类目属性Modal-->
    <div class="modal fade" id="setupAttribute">
        <div class="modal-dialog modal-lg">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                        <span aria-hidden="true">&times;</span></button>
                    <h4 class="modal-title">属性设置</h4>
                </div>
                <div class="modal-body">
                    <button type="button" class="btn btn-default" data-toggle="modal" data-target="#addAttribute">增加类目属性</button>
                    <br>
                    <br>
                    <table id="attributeTable" class="table table-bordered table-striped" style="width: 100%">

                    </table>
                </div>
            </div>
        </div>
    </div>

    <!--添加类目属性Modal-->
    <div class="modal fade" id="addAttribute">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close" onclick=" $('#attributeForm')[0].reset();">
                        <span aria-hidden="true">&times;</span></button>
                    <h4 class="modal-title">添加属性</h4>
                </div>
                <div class="modal-body">
                    <form class="form-horizontal" id="attributeForm">
                        <input type="hidden" id="classId" name="classId">
                        <input type="hidden" id="id" name="id">
                        <div class="box-body">
                            <div class="form-group">
                                <label for="name" class="col-sm-2 control-label">属性内容</label>

                                <div class="col-sm-10">
                                    <input type="text"  class="form-control" id="name" name="name" placeholder="请输入属性"/>
                                </div>
                            </div>
                        </div>
                    </form>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default pull-left" data-dismiss="modal" onclick="$('#attributeForm')[0].reset()">关闭</button>
                    <button type="button" class="btn btn-primary" onclick="CataLog.addAttribute()">保存</button>
                </div>
            </div>
        </div>
    </div>
</div>
</body>
</html>